package com.yanqu.road.server.cmd.unionwar;

import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.pb.activity.unionwar.CrossUnionWarProto;
import com.yanqu.road.server.cmd.CrossUnionCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.manager.unionwar.CrossUnionWarRankMgr;
import com.yanqu.road.server.protocol.CrossProtocol;

/**
 * @author ：zfr
 * @date ：2021/2/24 20:46
 */
@Cmd(code = CrossProtocol.C_CROSS_UNION_WAR_REQ_CHAMPION_ADD, desc = "请求跨服新增的冠军商会")
public class CrossUnionWarAddChampionCmd extends CrossUnionCommand {
    private int activityId;
    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        CrossUnionWarProto.CrossAddChampionReqMsg msg = CrossUnionWarProto.CrossAddChampionReqMsg.parseFrom(packet.getBytes());
        activityId = msg.getActivityId();
        return true;
    }

    @Override
    public void execute(YanQuMessage packet) throws Exception {
        CrossUnionWarRankMgr.addChampionSingleServer(serverId, activityId);
    }

    @Override
    public void sendData() {

    }
}
